package doujian.filter.rules;

import doujian.model.Host;
import doujian.model.Student;
import doujian.util.Log;

/**
 * 房间的匹配
 * 
 * Created by Majie on 2017/4/16.
 */
public class Room {
	/**
	 * 房间匹配
	 *
	 * @param stu
	 * @param host
	 * @return
	 */
	public static boolean filter(Student stu, Host host) {
		int producer = 0;
		for (doujian.model.Room room : host.rooms) {
			producer += room.max_person;
		}

		int consumer = stu.numberOfPeople;
		boolean result = producer >= consumer;
		Log.d("Room Filter: " + result);
		return result;
	}
}
